#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>

#define FOR(i,a,n) for(int i=a;i<n;++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;

int next[30000];
int ss[100100],sk[30000];
int n,k,s;

void getNext(int* s,int len)
{
    next[0]=-1;
    int j=0;
    FOR(i,1,len)
    {
        while(j&&s[j]!=s[i]) j=next[j-1]+1;
        if(s[i]==s[j]) next[i]=j++;
        else next[i]=-1;
    }
}
bool judgeSpecial()
{
    if(n<k)
    {
        puts("0");
        return true;
    }
    else if(n==1)
    {
        puts("1\n1");
        return true;
    }
    else if(k==1)
    {
        printf("%d\n",n);
        REP(i,n) printf("%d\n",i+1);
        return true;
    }
    return false;
}
void printAns(int* s,int* t,int slen,int tlen)
{
    getNext(t,tlen);
    vector<int> ans;
    int j=0;
    REP(i,slen)
    {
        while(j&&s[i]!=t[j]) j=next[j-1]+1;
        if(s[i]==t[j]) j++;
        if(j==tlen) ans.push_back(i-tlen+2);
    }
    printf("%d\n",ans.size());
    REP(i,ans.size()) printf("%d\n",ans[i]);
}
int main()
{
    while(cin>>n>>k>>s)
    {
        REP(i,n) scanf("%d",ss+i);
        REP(i,k) scanf("%d",sk+i);
        if(judgeSpecial()) continue;
        REP(i,n-1)
        {
            if(ss[i]==ss[i+1]) ss[i]=0;
            else if(ss[i]<ss[i+1]) ss[i]=-1;
            else ss[i]=1;
        }
        REP(i,k-1)
        {
            if(sk[i]==sk[i+1]) sk[i]=0;
            else if(sk[i]<sk[i+1]) sk[i]=-1;
            else sk[i]=1;
        }
        printAns(ss,sk,n-1,k-1);
    }
	return 0;
}
